package com.net128.beatportapps.downloader;

import java.awt.Component;
import java.awt.Dimension;

import javax.swing.JProgressBar;
import javax.swing.JTable;
import javax.swing.table.TableCellRenderer;

class ProgressRenderer extends JProgressBar implements TableCellRenderer {
	private static final long serialVersionUID = 1L;

	public ProgressRenderer(int min, int max) {
		super(min, max);
		setPreferredSize(new Dimension(1,20));
	}

	public Component getTableCellRendererComponent(JTable table, Object value,
			boolean isSelected, boolean hasFocus, int row, int column) {
		this.setForeground(table.getForeground());
		setValue((int) ((Float) value).floatValue());
		return this;
	}
}
